﻿using System;
using System.Xml.Serialization;
using nRoute.Components;
using nRoute.Utilities;
#if (WINRT)
using Windows.UI.Xaml.Markup;
#else
using System.Windows.Markup;
#endif

namespace nRoute.SiteMaps
{
#if (!SILVERLIGHT && !WINRT)
    [Serializable]
#endif
    [XmlRoot(ElementName = "AreaInfos", Namespace = SiteMaps.XMLNAMESPACE)]
    public class AreaInfosCollection
        : KeyedObservableCollection<string, SiteAreaInfo>
    {
        public AreaInfosCollection()
            : base(Utilities.Compatability.INVARIANT_IGNORECASE_STRING_COMPARER) { }

#region Overrides

        protected override string GetKeyForItem(SiteAreaInfo item)
        {
            Guard.ArgumentNotNull(item, "item");
            return item.Key;
        }

#endregion

    }
}
